home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / security / doc / clippings / 910826-01 < prev    next >
Encoding:
Internet Message Format  |  1991-09-11  |  4.9 KB

  1. From: al@ee.pitt.edu (A. Martello)
  2. Newsgroups: comp.unix.wizards
  3. Subject: SUMMARY: ftpd -> syslog vs. chroot
  4. Message-ID: <168440@unix.cis.pitt.edu>
  5. Date: 26 Aug 91 03:49:42 GMT
  6. Organization: Univ. of Pittsburgh, Electrical Engineering
  7.  
  8. Thanks to all who made suggestions regarding the syslog vs. chroot
  9. problem I encountered in ftpd.  Many suggested that adding the
  10. modifier LOG_NDELAY to the 'openlog' call should fix the problem,
  11. but it didn't for me (and at least one other respondent).
  12.  
  13. The answer I used was to get a new syslog.c file which had been
  14. modified to use the port defined in /etc/services instead of
  15. logging to /dev/log.  The modified syslog.c came from 
  16. jim@jagubox.gsfc.nasa.gov (Jim Jagielski).
  17.  
  18. My patches to ftpd along with the above mentioned syslog.c
  19. are available for anonymous ftp.  The README file is below.
  20.  
  21. *******************************************************************
  22.        Alan R. Martello        Electrical Engineering Dept.
  23.         al@ee.pitt.edu           University of Pittsburgh
  24. *******************************************************************
  25.  
  26. This is the file README included in the shell archive available from
  27. jupiter.ee.pitt.edu (130.49.15.1) /pub/ftpd.mod.shar.
  28.  
  29. This file documents the changes made by Alan Martello (al@ee.pitt.edu)
  30. to the Berleley ftp daemon obtained from uunet.uu.net.  You need both
  31. the ftp and ftpd tar files from uunet to recreate the new ftpd since
  32. they share some common routines.
  33.  
  34.  
  35. NOTE: You should be very familiar with the ftpd(8) man page before
  36. reading this file.
  37.  
  38. The shell archive contains the following files:
  39. README   - this file
  40. PATCH    - the patch file
  41. glob.c   - file they forgot in ftpd.Z but is in ftp.Z; needed to build ftpd
  42. syslog.c - modified syslog file which logs via /etc/services not /dev/log
  43. SAMPLE_PATH_SPECIAL - a sample _PATH_SPECIAL file
  44. SAMPLE_INDIRECT_FILE - a sample file pointed to by SAMPLE_PATH_SPECIAL
  45.  
  46. The ftp daemon was modified to define three types of users as being
  47. allowed to have ftp access:
  48.  
  49. 1) users with local accounts
  50. 2) users without a local account via an anonymous login
  51. 3) users without a local account via a pasword protected login
  52.  
  53. If either 2 or 3 are to be used, then the user 'ftp' MUST
  54. be created.  This user must exist since both type 2 and 3
  55. login accounts chroot to ~ftp after login.
  56.  
  57. Logging facilities via syslog(3) have been modified to provide
  58. selective logging of user login and file retreival (get's).
  59.  
  60. Logging of successful logins is performed via syslog
  61. at level LOG_NOTICE progided that logging is turned
  62. on (via the -l flag to ftpd).
  63.  
  64. Logging of get's is performed via syslog at the level of LOG_INFO
  65. if it is compiled in AND logging is enabled (via the -l flag to ftpd).
  66.  
  67. Note that due to bugs in the syslog.c file in the standard library,
  68. a new syslog.c file has been included which logs to the port
  69. listed in /etc/services.  This corrects the problem with syslog
  70. being "turned off" once a chroot was performed since the socket
  71. /dev/log could no longer be accessed for logging.
  72.  
  73. Configuration options (things to tweak in ftpd.c)
  74. -------------------------------------------------
  75. List of strings 'guest_login' has been defined which determines the
  76. names of the default guest logins (by default 'ftp' and 'anonymous').
  77.  
  78. LOG_GET_LOCAL - #define which determines whether to compile in support
  79.     for logging get's of files for local (type 1) users.
  80.  
  81. LOG_GET_GUEST - #define which determines whether to compile in support
  82.     for logging get's of files for guest_login (type 2) users.
  83.  
  84. LOG_GET_SPECIAL - #define which determines whether to compile in support
  85.     for logging get's of files for special (type 3) users.
  86.  
  87. USER_LOCAL - #define which determines whether to compile in code to
  88.     allow local (type 1) users to login.
  89.  
  90. USER_GUEST - #define which determines whether to compile in code to
  91.     allow guest_login (type 2) users to login.
  92.  
  93. USER_SPECIAL - #define which determines whether to compile in code to
  94.     allow special (type 3) users to login.
  95.  
  96. Installation Notes
  97. ------------------
  98. 0) obtain ftpd and ftp tar files from uunet.uu.net:/networking and
  99. apply the supplied PATCH file
  100.  
  101. 1) Configure the #define symbols at the top of ftpd.c as desired.
  102.  
  103. 2) Create a new ftpd and replace the current in.ftpd pointed to
  104. by /etc/inetd.conf; add the '-l' flag to the invocation of in.ftpd 
  105. if any logging is to be performed.
  106.  
  107. 3) Create the file defined in pathnames as _PATH_SPECIAL to list the 
  108. special password protected accounts (if included in ftpd.c).
  109. The format of _PATH_SPECIAL is shown in the file SAMPLE_PATH_SPECIAL
  110.  
  111. 5) Create any files pointed to by the file specified as _PATH_SPECIAL.
  112. The format of these files is shown in SAMPLE_INDIRECT_FILE.  MAKE SURE
  113. ALL THESE FILES ARE OWNED BY ROOT AND HAVE PROTECTION 600 SINCE THEY
  114. CONTAIN UNENCRYPTED PASSWORDS.
  115.  
  116. 6) make
  117.  
  118. 7) install in place of the old ftpd (make sure you save the old one first)
  119.  
  120. ----------------------------------------------------------------------
  121. end of message
  122.  
  123.